package model.macro
{
	
	/**
	 */
	public class Building
	{
		static public const CITY_CENTER:Building = new Building("City Center", 10, new <Weapon>[Weapon.SWORD], new <Armor>[Armor.CLOTH]);
		static public const BLACKSMITH:Building = new Building("Blacksmith", 10);
		static public const ACADEMY:Building = new Building("Academy", 20);
		static public const BARRACKS:Building = new Building("Barracks", -5);
		static public const STABLES:Building = new Building("Stables", 15);
		static public const SEIGE_WORKSHOP:Building = new Building("Seige Workshop", 10);
		static public const MARKET:Building = new Building("Market", 30);
		
		private var _allowed_weapons:Vector.<Weapon>;
		private var _allowed_armors:Vector.<Armor>;
		public var name:String;
		public var gold_per_turn:int;
		
		/**
		 *
		 * @param	gold_per_turn
		 */
		public function Building(name:String, gold_per_turn:int, allowed_weapons:Vector.<Weapon> = null, allowed_armors:Vector.<Armor> = null)
		{
			this.name = name;
			this.gold_per_turn = gold_per_turn;
			
			if (allowed_weapons == null) allowed_weapons = new Vector.<Weapon>();
			if (allowed_armors == null) allowed_armors = new Vector.<Armor>();
			
			_allowed_armors = allowed_armors.concat();
			_allowed_weapons = allowed_weapons.concat();
		}
		
		/**
		 *
		 */
		public function get allowed_weapons():Vector.<Weapon>
		{
			return _allowed_weapons;
		}
		
		/**
		 *
		 */
		public function get allowed_armors():Vector.<Armor>
		{
			return _allowed_armors;
		}
	}
}